package com.qingcloud.base.api.remote.admin.factory;


import com.qingcloud.base.api.remote.admin.AdminApi;
import com.qingcloud.base.api.remote.admin.fallback.AdminApiFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class AdminApiFallbackFactory implements FallbackFactory<AdminApi> {
    @Override
    public AdminApi create(Throwable throwable) {
        AdminApiFallback fallback = new AdminApiFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
